﻿using System.Collections.ObjectModel;
using System.Windows;
using AuthInfrastructure;

namespace UIAuth.Examples.VM
{
    [AuthSecurityName("entireVM")]
    public class PeoplesVM : ViewModelBase
    {
        public PeoplesVM()
        {
            InvisiblePeoples = new ObservableCollection<People>
                                   {
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                       new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                   };
            ReadOnlyPeopele = new ObservableCollection<People>
                                  {
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                      new People {FirstName = "Boo", Mail = "Boo@Boo.com"},
                                  };
        }

        [AuthSecurityName("invisible")]
        public ObservableCollection<People> InvisiblePeoples { get; set; }

        [AuthSecurityName("readonly")]
        public ObservableCollection<People> ReadOnlyPeopele { get; set; }

        [AuthSecurityName("all")]
        public DelegateCommand ShowMbox
        {
            get { return new DelegateCommand(_ => { MessageBox.Show("Test"); }); }
        }

        [AuthSecurityName("readonly")]
        public DelegateCommand DisableBtn
        {
            get { return new DelegateCommand(_ => { MessageBox.Show("Test"); }); }
        }

        // implicit level from the VM class
        public DelegateCommand EntrieVM
        {
            get { return new DelegateCommand(_ => { MessageBox.Show("Test"); }); }
        }
    }
}